#ifndef SPL_BUTTON
#define SPL_BUTTON

class DLLEXPORT Button : public Controls::Control
{
private:
  BOOL      fClicked;
  BOOL      fHovered;
  BOOL      fFocused;
  INT       frameHighlight;
  INT       frameShadow;
  COLORREF  foreColor;

  VOID  paintBackground(
    Gdip::Graphics    &g,
    const Gdip::Rect  &bounds
    );

  VOID  paintText(
    Gdip::Graphics    &g,
    const Gdip::Rect  &bounds
    );

protected:
  virtual VOID onKeyDown(Event::KeyEvent&);
  virtual VOID onSetFocus(Event::FocusEvent&);
  virtual VOID onKillFocus(Event::FocusEvent&);
  virtual VOID onMouseMove(Event::MouseEvent&);
  virtual VOID onMouseLeave();
  virtual VOID onMouseDown(Event::MouseEvent&);
  virtual VOID onMouseUp(Event::MouseEvent&);
  virtual VOID onTimer(Event::TimerEvent&);
  virtual VOID onControlPaint(Controls::ControlPaintEvent& iEvent);

public:
  SPLINL COLORREF getForeColor()
  {
    return foreColor;
  }
  SPLINL VOID setForeColor(COLORREF value)
  {
    foreColor = value;
  }

  VOID  doClick();

  SPLINL  Button() :
    fClicked(FALSE),
    fHovered(FALSE),
    fFocused(FALSE),
    frameHighlight(0),
    frameShadow(0),
    foreColor(0xFFFFFF)
  {
  }
};

#endif